<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html">
<h:head>
    <title>#{msg.page_mySettings}</title>

</h:head>
<h:body>
    <ui:decorate template="/sample.xhtml">
        <ui:define name="body">
            Мои настройки

            <h:form>
                <table border="1px" >

                    <tr style="background: red;">
                        <td>ID </td>
                        <td><h:outputText value="#{userBean.id}"/> </td>
                        <td><h:inputText value="#{userBean.id}" disabled="true"/> </td>

                    </tr>
                    <tr>
                        <td>#{msg.text_login}</td>
                        <td><h:outputText value="#{userBean.login}"/> </td>
                        <td> <h:inputText id="login" value="#{userBean.login}" required="true"
                                         requiredMessage="#{msg.text_enterLogin}"
                                         validator="#{userBean.checkLogin}"/>
                        </td>

                    </tr>
                    <tr>
                        <td>#{msg.text_birthday}</td>
                        <td><h:outputText value="#{userBean.birhday}"/> </td>
                       <td>    <h:inputText id="date" value="#{userBean.birhday}"
                                            size="20" required="true"
                                            requiredMessage="#{msg.text_date}"
                                            validatorMessage="#{msg.text_date}"
                               >

                           <f:convertDateTime pattern="d-M-yyyy" />
                       </h:inputText>
                       </td>

                    </tr>
                    <tr>
                        <td>#{msg.text_pass}</td>
                        <td><h:outputText value="*****"/> </td>
                        <td><h:inputText value="****" disabled="true"/> </td>

                    </tr>
                    <tr style="background: red;">
                        <td>#{msg.text_accessLevel}</td>
                        <td><h:outputText value="#{userBean.accessLevel}"/> </td>
                        <td><h:inputText value="#{userBean.accessLevel}" disabled="true"/> </td>

                    </tr>
                    <tr>
                        <td>#{msg.text_email}</td>
                        <td><h:outputText value="#{userBean.email}"/> </td>
                        <td><h:inputText value="#{userBean.email}" /> </td>

                    </tr>
                    <tr>
                        <td>#{msg.text_city}</td>
                        <td><h:outputText value="#{userBean.city}"/> </td>
                        <td>

                            <p:selectOneMenu value="#{city.countryUser}" valueChangeListener="#{city.countrySet}" onchange="submit()">
                                <f:selectItem itemLabel="---" itemValue=""/>
                                <f:selectItems value="#{city.countries}" var="j" itemLabel="#{j.name}" />

                            </p:selectOneMenu>

                            <br/>
                            <p:selectOneMenu value="#{userBean.city}" valueChangeListener="#{userBean.citiesSet}" onchange="submit()">
                                <f:selectItem itemLabel="---" itemValue=""/>
                                <f:selectItems value="#{city.cities}" var="j1" itemLabel="#{j1.value}" itemValue="#{j1.id}" />

                            </p:selectOneMenu>


                        </td>

                    </tr>
                    <tr>
                        <td>#{msg.text_localeApplication}</td>
                        <td><h:outputText value="#{userBean.locale}"/> </td>
                        <td>
                            <h:selectOneMenu value="#{userBean.locale}" onchange="submit()"
                                             valueChangeListener="#{userBean.localeSet}">
                                <f:selectItems value="#{userBean.listLocale}" var="locale"
                                               itemLabel="#{locale}" itemValue="#{locale}"/>
                            </h:selectOneMenu>

                        
                        </td>

                    </tr>
                </table>
                <h:commandButton value="#{msg.text_saveEdit}" action="#{userBean.updateUser}"/>
                <h:message for="date" style="color:red" /> <br/>
                <h:message for="login" style="color: red;" /><br/>

<!---->



            </h:form>
            <h:form>



            </h:form>
        </ui:define>
    </ui:decorate>










</h:body>
</html>


